<!-- HTML header for doxygen 1.8.20-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
	<meta http-equiv="X-UA-Compatible" content="IE=9"/>
	<meta name="generator" content="Doxygen 1.9.4"/>
	<meta name="viewport" content="width=device-width, initial-scale=1"/>
	<title>Raspberry Pi Pico SDK: hardware_uart</title>
	<!-- <link href="tabs.css" rel="stylesheet" type="text/css"/> -->
	<script type="text/javascript" src="jquery.js"></script>
	<script type="text/javascript" src="dynsections.js"></script>
	<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
	<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
    <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
	<link href="doxygen.css" rel="stylesheet" type="text/css" />
	<link href="normalise.css" rel="stylesheet" type="text/css"/>
<link href="main.css" rel="stylesheet" type="text/css"/>
<link href="styles.css" rel="stylesheet" type="text/css"/>
</head>
<body>
	<div class="navigation-mobile">
		<div class="logo--mobile">
			<a href="/"><img src="logo-mobile.svg" alt="Raspberry Pi"></a>
		</div>
		<div class="navigation-toggle">
			<span class="line-1"></span>
			<span class="line-2">
				<p>Menu Toggle</p>
			</span>
			<span class="line-3"></span>
		</div>
	</div>
	<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
		<div class="logo">
			<a href="index.html"> <img src="logo.svg" alt="Raspberry Pi"></a>
			<span style="display: inline-block; margin-top: 10px;">
				v2.0.0
			</span>
		</div>
		<div class="navigation-footer">
			<img src="logo-mobile.svg" alt="Raspberry Pi">
			<a href="https://www.raspberrypi.com/" target="_blank">By Raspberry Pi Ltd</a>
		</div>
<!-- 		<div class="search">
			<form>
				<input type="search" name="search" id="search" placeholder="Search">
				<input type="submit" value="Search">
			</form>
		</div> -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('group__hardware__uart.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">hardware_uart<div class="ingroups"><a class="el" href="group__hardware.html">Hardware APIs</a></div></div></div>
</div><!--header-->
<div class="contents">

<p>Hardware UART API.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ga12815b6262573d95c8a749f64cc85284"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__uart.html#ga12815b6262573d95c8a749f64cc85284">UART_NUM</a>(uart)</td></tr>
<tr class="memdesc:ga12815b6262573d95c8a749f64cc85284"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the UART number for a UART instance.  <a href="group__hardware__uart.html#ga12815b6262573d95c8a749f64cc85284">More...</a><br /></td></tr>
<tr class="separator:ga12815b6262573d95c8a749f64cc85284"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gadc5c5947dc577aac3d448fdb37647927"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__uart.html#gadc5c5947dc577aac3d448fdb37647927">UART_INSTANCE</a>(num)</td></tr>
<tr class="memdesc:gadc5c5947dc577aac3d448fdb37647927"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the UART instance with the given UART number.  <a href="group__hardware__uart.html#gadc5c5947dc577aac3d448fdb37647927">More...</a><br /></td></tr>
<tr class="separator:gadc5c5947dc577aac3d448fdb37647927"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga10472af6afab1cb220b5fbd4aee63a16"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__uart.html#ga10472af6afab1cb220b5fbd4aee63a16">UART_DREQ_NUM</a>(uart,  is_tx)</td></tr>
<tr class="memdesc:ga10472af6afab1cb220b5fbd4aee63a16"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the <a class="el" href="group__hardware__dma.html#ga8def0ea481095c94f3a0dd0b4fed999e">dreq_num_t</a> used for pacing DMA transfers to or from this UART instance. If is_tx is true, then it is for transfers to the UART else for transfers from the UART.  <a href="group__hardware__uart.html#ga10472af6afab1cb220b5fbd4aee63a16">More...</a><br /></td></tr>
<tr class="separator:ga10472af6afab1cb220b5fbd4aee63a16"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8b4f387572a62cc839eb004ce7c02e3f"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__uart.html#ga8b4f387572a62cc839eb004ce7c02e3f">UART_CLOCK_NUM</a>(uart)</td></tr>
<tr class="memdesc:ga8b4f387572a62cc839eb004ce7c02e3f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns <a class="el" href="group__hardware__clocks.html#ga824c11c2ae315e0b745f6dd3db936788">clock_num_t</a> of the clock for the given UART instance.  <a href="group__hardware__uart.html#ga8b4f387572a62cc839eb004ce7c02e3f">More...</a><br /></td></tr>
<tr class="separator:ga8b4f387572a62cc839eb004ce7c02e3f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7bceb145d3739e3923f64584eff6db59"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__uart.html#ga7bceb145d3739e3923f64584eff6db59">UART_FUNCSEL_NUM</a>(uart,  gpio)</td></tr>
<tr class="memdesc:ga7bceb145d3739e3923f64584eff6db59"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns <a class="el" href="group__hardware__gpio.html#ga89b8e5e8a9c515260dea8d1fa96e72c9">gpio_function_t</a> needed to select the UART function for the given UART instance on the given GPIO number.  <a href="group__hardware__uart.html#ga7bceb145d3739e3923f64584eff6db59">More...</a><br /></td></tr>
<tr class="separator:ga7bceb145d3739e3923f64584eff6db59"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8697ddad82a2cd5d889ce819d83783e3"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__uart.html#ga8697ddad82a2cd5d889ce819d83783e3">UART_IRQ_NUM</a>(uart)</td></tr>
<tr class="memdesc:ga8697ddad82a2cd5d889ce819d83783e3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the <a class="el" href="group__hardware__irq.html#gaf30862f51b5994ffd5863176a185d137">irq_num_t</a> for processor interrupts from the given UART instance.  <a href="group__hardware__uart.html#ga8697ddad82a2cd5d889ce819d83783e3">More...</a><br /></td></tr>
<tr class="separator:ga8697ddad82a2cd5d889ce819d83783e3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaffef755f98d8fcec5f7b5147924fb4f9"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__uart.html#gaffef755f98d8fcec5f7b5147924fb4f9">UART_RESET_NUM</a>(uart)</td></tr>
<tr class="memdesc:gaffef755f98d8fcec5f7b5147924fb4f9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the <a class="el" href="group__hardware__resets.html#ga53804b75cce5eb3090d482b0af2a7ce0">reset_num_t</a> used to reset a given UART instance.  <a href="group__hardware__uart.html#gaffef755f98d8fcec5f7b5147924fb4f9">More...</a><br /></td></tr>
<tr class="separator:gaffef755f98d8fcec5f7b5147924fb4f9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="enum-members" name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:ga6bcc37e31dd40c204b4ac6f6189e8878"><td class="memItemLeft" align="right" valign="top"><a id="ga6bcc37e31dd40c204b4ac6f6189e8878" name="ga6bcc37e31dd40c204b4ac6f6189e8878"></a>enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__uart.html#ga6bcc37e31dd40c204b4ac6f6189e8878">uart_parity_t</a> { <b>UART_PARITY_NONE</b>
, <b>UART_PARITY_EVEN</b>
, <b>UART_PARITY_ODD</b>
 }</td></tr>
<tr class="memdesc:ga6bcc37e31dd40c204b4ac6f6189e8878"><td class="mdescLeft">&#160;</td><td class="mdescRight">UART Parity enumeration. <br /></td></tr>
<tr class="separator:ga6bcc37e31dd40c204b4ac6f6189e8878"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga064c5c42afff8712a612d7ae50a58484"><td class="memItemLeft" align="right" valign="top">static uint&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__uart.html#ga064c5c42afff8712a612d7ae50a58484">uart_get_index</a> (uart_inst_t *uart)</td></tr>
<tr class="memdesc:ga064c5c42afff8712a612d7ae50a58484"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert UART instance to hardware instance number.  <a href="group__hardware__uart.html#ga064c5c42afff8712a612d7ae50a58484">More...</a><br /></td></tr>
<tr class="separator:ga064c5c42afff8712a612d7ae50a58484"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gafd9aaeaae78307db7f51aa39f501b972"><td class="memItemLeft" align="right" valign="top">static uart_inst_t *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__uart.html#gafd9aaeaae78307db7f51aa39f501b972">uart_get_instance</a> (uint num)</td></tr>
<tr class="memdesc:gafd9aaeaae78307db7f51aa39f501b972"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the UART instance from an instance number.  <a href="group__hardware__uart.html#gafd9aaeaae78307db7f51aa39f501b972">More...</a><br /></td></tr>
<tr class="separator:gafd9aaeaae78307db7f51aa39f501b972"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga460772353a17df99adaf3352115c73d5"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="structuart__hw__t.html">uart_hw_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__uart.html#ga460772353a17df99adaf3352115c73d5">uart_get_hw</a> (uart_inst_t *uart)</td></tr>
<tr class="memdesc:ga460772353a17df99adaf3352115c73d5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the real hardware UART instance from a UART instance.  <a href="group__hardware__uart.html#ga460772353a17df99adaf3352115c73d5">More...</a><br /></td></tr>
<tr class="separator:ga460772353a17df99adaf3352115c73d5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5a55924eff530aff6db3b15fd872cda4"><td class="memItemLeft" align="right" valign="top">uint&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__uart.html#ga5a55924eff530aff6db3b15fd872cda4">uart_init</a> (uart_inst_t *uart, uint baudrate)</td></tr>
<tr class="memdesc:ga5a55924eff530aff6db3b15fd872cda4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialise a UART.  <a href="group__hardware__uart.html#ga5a55924eff530aff6db3b15fd872cda4">More...</a><br /></td></tr>
<tr class="separator:ga5a55924eff530aff6db3b15fd872cda4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga85b12f7d19f5087b22f26473039d2c4f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__uart.html#ga85b12f7d19f5087b22f26473039d2c4f">uart_deinit</a> (uart_inst_t *uart)</td></tr>
<tr class="memdesc:ga85b12f7d19f5087b22f26473039d2c4f"><td class="mdescLeft">&#160;</td><td class="mdescRight">DeInitialise a UART.  <a href="group__hardware__uart.html#ga85b12f7d19f5087b22f26473039d2c4f">More...</a><br /></td></tr>
<tr class="separator:ga85b12f7d19f5087b22f26473039d2c4f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab7f2ad3380a44597d8dda42b2d2ddef9"><td class="memItemLeft" align="right" valign="top">uint&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__uart.html#gab7f2ad3380a44597d8dda42b2d2ddef9">uart_set_baudrate</a> (uart_inst_t *uart, uint baudrate)</td></tr>
<tr class="memdesc:gab7f2ad3380a44597d8dda42b2d2ddef9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set UART baud rate.  <a href="group__hardware__uart.html#gab7f2ad3380a44597d8dda42b2d2ddef9">More...</a><br /></td></tr>
<tr class="separator:gab7f2ad3380a44597d8dda42b2d2ddef9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga54a9e298ebec96510e324bbab01247c7"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__uart.html#ga54a9e298ebec96510e324bbab01247c7">uart_set_hw_flow</a> (uart_inst_t *uart, bool cts, bool rts)</td></tr>
<tr class="memdesc:ga54a9e298ebec96510e324bbab01247c7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set UART flow control CTS/RTS.  <a href="group__hardware__uart.html#ga54a9e298ebec96510e324bbab01247c7">More...</a><br /></td></tr>
<tr class="separator:ga54a9e298ebec96510e324bbab01247c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga07e3c6ce7c1abf5e875b62964b8f841e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__uart.html#ga07e3c6ce7c1abf5e875b62964b8f841e">uart_set_format</a> (uart_inst_t *uart, uint data_bits, uint stop_bits, <a class="el" href="group__hardware__uart.html#ga6bcc37e31dd40c204b4ac6f6189e8878">uart_parity_t</a> parity)</td></tr>
<tr class="memdesc:ga07e3c6ce7c1abf5e875b62964b8f841e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set UART data format.  <a href="group__hardware__uart.html#ga07e3c6ce7c1abf5e875b62964b8f841e">More...</a><br /></td></tr>
<tr class="separator:ga07e3c6ce7c1abf5e875b62964b8f841e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1908247cb5f2468517b37d5a91798181"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__uart.html#ga1908247cb5f2468517b37d5a91798181">uart_set_irqs_enabled</a> (uart_inst_t *uart, bool rx_has_data, bool tx_needs_data)</td></tr>
<tr class="memdesc:ga1908247cb5f2468517b37d5a91798181"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enable/Disable UART interrupt outputs.  <a href="group__hardware__uart.html#ga1908247cb5f2468517b37d5a91798181">More...</a><br /></td></tr>
<tr class="separator:ga1908247cb5f2468517b37d5a91798181"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6397bfad56e634a2ab31b6953a44caa7"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__uart.html#ga6397bfad56e634a2ab31b6953a44caa7">uart_is_enabled</a> (uart_inst_t *uart)</td></tr>
<tr class="memdesc:ga6397bfad56e634a2ab31b6953a44caa7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Test if specific UART is enabled.  <a href="group__hardware__uart.html#ga6397bfad56e634a2ab31b6953a44caa7">More...</a><br /></td></tr>
<tr class="separator:ga6397bfad56e634a2ab31b6953a44caa7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac3daee9514dacfb76f3c04b131e2e41a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__uart.html#gac3daee9514dacfb76f3c04b131e2e41a">uart_set_fifo_enabled</a> (uart_inst_t *uart, bool enabled)</td></tr>
<tr class="memdesc:gac3daee9514dacfb76f3c04b131e2e41a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enable/Disable the FIFOs on specified UART.  <a href="group__hardware__uart.html#gac3daee9514dacfb76f3c04b131e2e41a">More...</a><br /></td></tr>
<tr class="separator:gac3daee9514dacfb76f3c04b131e2e41a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9d307ef71e3ce632be03bfd9bbe68117"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__uart.html#ga9d307ef71e3ce632be03bfd9bbe68117">uart_is_writable</a> (uart_inst_t *uart)</td></tr>
<tr class="memdesc:ga9d307ef71e3ce632be03bfd9bbe68117"><td class="mdescLeft">&#160;</td><td class="mdescRight">Determine if space is available in the TX FIFO.  <a href="group__hardware__uart.html#ga9d307ef71e3ce632be03bfd9bbe68117">More...</a><br /></td></tr>
<tr class="separator:ga9d307ef71e3ce632be03bfd9bbe68117"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaff99ad133c2c808b69d1e12054c09f4a"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__uart.html#gaff99ad133c2c808b69d1e12054c09f4a">uart_tx_wait_blocking</a> (uart_inst_t *uart)</td></tr>
<tr class="memdesc:gaff99ad133c2c808b69d1e12054c09f4a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Wait for the UART TX fifo to be drained.  <a href="group__hardware__uart.html#gaff99ad133c2c808b69d1e12054c09f4a">More...</a><br /></td></tr>
<tr class="separator:gaff99ad133c2c808b69d1e12054c09f4a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4752e5d03dd98a08d95705f68784fd15"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__uart.html#ga4752e5d03dd98a08d95705f68784fd15">uart_is_readable</a> (uart_inst_t *uart)</td></tr>
<tr class="memdesc:ga4752e5d03dd98a08d95705f68784fd15"><td class="mdescLeft">&#160;</td><td class="mdescRight">Determine whether data is waiting in the RX FIFO.  <a href="group__hardware__uart.html#ga4752e5d03dd98a08d95705f68784fd15">More...</a><br /></td></tr>
<tr class="separator:ga4752e5d03dd98a08d95705f68784fd15"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gada6a512414b1113a59725ddfbe23c4a5"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__uart.html#gada6a512414b1113a59725ddfbe23c4a5">uart_write_blocking</a> (uart_inst_t *uart, const uint8_t *src, size_t len)</td></tr>
<tr class="memdesc:gada6a512414b1113a59725ddfbe23c4a5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write to the UART for transmission.  <a href="group__hardware__uart.html#gada6a512414b1113a59725ddfbe23c4a5">More...</a><br /></td></tr>
<tr class="separator:gada6a512414b1113a59725ddfbe23c4a5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae8a066ef7339e7b22f05049435469234"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__uart.html#gae8a066ef7339e7b22f05049435469234">uart_read_blocking</a> (uart_inst_t *uart, uint8_t *dst, size_t len)</td></tr>
<tr class="memdesc:gae8a066ef7339e7b22f05049435469234"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read from the UART.  <a href="group__hardware__uart.html#gae8a066ef7339e7b22f05049435469234">More...</a><br /></td></tr>
<tr class="separator:gae8a066ef7339e7b22f05049435469234"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga64aa17c4b4382a59f7cb80c94f339d56"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__uart.html#ga64aa17c4b4382a59f7cb80c94f339d56">uart_putc_raw</a> (uart_inst_t *uart, char c)</td></tr>
<tr class="memdesc:ga64aa17c4b4382a59f7cb80c94f339d56"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write single character to UART for transmission.  <a href="group__hardware__uart.html#ga64aa17c4b4382a59f7cb80c94f339d56">More...</a><br /></td></tr>
<tr class="separator:ga64aa17c4b4382a59f7cb80c94f339d56"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga21c2cc29dcdc99ad970024dca52665a5"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__uart.html#ga21c2cc29dcdc99ad970024dca52665a5">uart_putc</a> (uart_inst_t *uart, char c)</td></tr>
<tr class="memdesc:ga21c2cc29dcdc99ad970024dca52665a5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write single character to UART for transmission, with optional CR/LF conversions.  <a href="group__hardware__uart.html#ga21c2cc29dcdc99ad970024dca52665a5">More...</a><br /></td></tr>
<tr class="separator:ga21c2cc29dcdc99ad970024dca52665a5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga94be41517216933ca961fd0464f74a6c"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__uart.html#ga94be41517216933ca961fd0464f74a6c">uart_puts</a> (uart_inst_t *uart, const char *s)</td></tr>
<tr class="memdesc:ga94be41517216933ca961fd0464f74a6c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write string to UART for transmission, doing any CR/LF conversions.  <a href="group__hardware__uart.html#ga94be41517216933ca961fd0464f74a6c">More...</a><br /></td></tr>
<tr class="separator:ga94be41517216933ca961fd0464f74a6c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga652497b933112c1759f892a03c657fec"><td class="memItemLeft" align="right" valign="top">static char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__uart.html#ga652497b933112c1759f892a03c657fec">uart_getc</a> (uart_inst_t *uart)</td></tr>
<tr class="memdesc:ga652497b933112c1759f892a03c657fec"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read a single character from the UART.  <a href="group__hardware__uart.html#ga652497b933112c1759f892a03c657fec">More...</a><br /></td></tr>
<tr class="separator:ga652497b933112c1759f892a03c657fec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaddb01507886acab5604a2eecc014b388"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__uart.html#gaddb01507886acab5604a2eecc014b388">uart_set_break</a> (uart_inst_t *uart, bool en)</td></tr>
<tr class="memdesc:gaddb01507886acab5604a2eecc014b388"><td class="mdescLeft">&#160;</td><td class="mdescRight">Assert a break condition on the UART transmission.  <a href="group__hardware__uart.html#gaddb01507886acab5604a2eecc014b388">More...</a><br /></td></tr>
<tr class="separator:gaddb01507886acab5604a2eecc014b388"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4ea0b7b9252cd22e2395ca6070000f7a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__uart.html#ga4ea0b7b9252cd22e2395ca6070000f7a">uart_set_translate_crlf</a> (uart_inst_t *uart, bool translate)</td></tr>
<tr class="memdesc:ga4ea0b7b9252cd22e2395ca6070000f7a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set CR/LF conversion on UART.  <a href="group__hardware__uart.html#ga4ea0b7b9252cd22e2395ca6070000f7a">More...</a><br /></td></tr>
<tr class="separator:ga4ea0b7b9252cd22e2395ca6070000f7a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaaa85ae059028b3f38e612e55042a8272"><td class="memItemLeft" align="right" valign="top"><a id="gaaa85ae059028b3f38e612e55042a8272" name="gaaa85ae059028b3f38e612e55042a8272"></a>
static void&#160;</td><td class="memItemRight" valign="bottom"><b>uart_default_tx_wait_blocking</b> (void)</td></tr>
<tr class="memdesc:gaaa85ae059028b3f38e612e55042a8272"><td class="mdescLeft">&#160;</td><td class="mdescRight">Wait for the default UART's TX FIFO to be drained. <br /></td></tr>
<tr class="separator:gaaa85ae059028b3f38e612e55042a8272"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga026539f355b6c6f5a044a5f4ee051f0e"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__uart.html#ga026539f355b6c6f5a044a5f4ee051f0e">uart_is_readable_within_us</a> (uart_inst_t *uart, uint32_t us)</td></tr>
<tr class="memdesc:ga026539f355b6c6f5a044a5f4ee051f0e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Wait for up to a certain number of microseconds for the RX FIFO to be non empty.  <a href="group__hardware__uart.html#ga026539f355b6c6f5a044a5f4ee051f0e">More...</a><br /></td></tr>
<tr class="separator:ga026539f355b6c6f5a044a5f4ee051f0e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaee105a6aeabd79da9244a098865e28cd"><td class="memItemLeft" align="right" valign="top">static uint&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__uart.html#gaee105a6aeabd79da9244a098865e28cd">uart_get_dreq_num</a> (uart_inst_t *uart, bool is_tx)</td></tr>
<tr class="memdesc:gaee105a6aeabd79da9244a098865e28cd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the <a class="el" href="group__hardware__dma.html#ga8def0ea481095c94f3a0dd0b4fed999e">dreq_num_t</a> to use for pacing transfers to/from a particular UART instance.  <a href="group__hardware__uart.html#gaee105a6aeabd79da9244a098865e28cd">More...</a><br /></td></tr>
<tr class="separator:gaee105a6aeabd79da9244a098865e28cd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0759dec413fb5af3bcaa9691ba98bcb9"><td class="memItemLeft" align="right" valign="top">static uint&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__uart.html#ga0759dec413fb5af3bcaa9691ba98bcb9">uart_get_reset_num</a> (uart_inst_t *uart)</td></tr>
<tr class="memdesc:ga0759dec413fb5af3bcaa9691ba98bcb9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the <a class="el" href="group__hardware__resets.html#ga53804b75cce5eb3090d482b0af2a7ce0">reset_num_t</a> to use for pacing transfers to/from a particular UART instance.  <a href="group__hardware__uart.html#ga0759dec413fb5af3bcaa9691ba98bcb9">More...</a><br /></td></tr>
<tr class="separator:ga0759dec413fb5af3bcaa9691ba98bcb9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4c45ff280c79aa60358d8241b7e5824b"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__uart.html#ga4c45ff280c79aa60358d8241b7e5824b">uart0</a>&#160;&#160;&#160;((uart_inst_t *)uart0_hw)</td></tr>
<tr class="memdesc:ga4c45ff280c79aa60358d8241b7e5824b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Identifier for UART instance 0.  <a href="group__hardware__uart.html#ga4c45ff280c79aa60358d8241b7e5824b">More...</a><br /></td></tr>
<tr class="separator:ga4c45ff280c79aa60358d8241b7e5824b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad94ac6d5e345a1f794174d9bb7c6f69c"><td class="memItemLeft" align="right" valign="top"><a id="gad94ac6d5e345a1f794174d9bb7c6f69c" name="gad94ac6d5e345a1f794174d9bb7c6f69c"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>uart1</b>&#160;&#160;&#160;((uart_inst_t *)uart1_hw)</td></tr>
<tr class="memdesc:gad94ac6d5e345a1f794174d9bb7c6f69c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Identifier for UART instance 1. <br /></td></tr>
<tr class="separator:gad94ac6d5e345a1f794174d9bb7c6f69c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p >Hardware UART API. </p>
<p >RP-series microcontrollers have 2 identical instances of a UART peripheral, based on the ARM PL011. Each UART can be connected to a number of GPIO pins as defined in the GPIO muxing.</p>
<p >Only the TX, RX, RTS, and CTS signals are connected, meaning that the modem mode and IrDA mode of the PL011 are not supported.</p>
<h2><a class="anchor" id="uart_example"></a>
Example</h2>
<div class="fragment"><div class="line"> <span class="keywordtype">int</span> main() {</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Set the GPIO pin mux to the UART - pin 0 is TX, 1 is RX; note use of UART_FUNCSEL_NUM for the general</span></div>
<div class="line">    <span class="comment">// case where the func sel used for UART depends on the pin number</span></div>
<div class="line">    <span class="comment">// Do this before calling uart_init to avoid losing data</span></div>
<div class="line">    <a class="code hl_function" href="group__hardware__gpio.html#ga22f6b90c4c7e0013b4b5341de0a44fc4">gpio_set_function</a>(0, <a class="code hl_define" href="group__hardware__uart.html#ga7bceb145d3739e3923f64584eff6db59">UART_FUNCSEL_NUM</a>(<a class="code hl_define" href="group__hardware__uart.html#ga4c45ff280c79aa60358d8241b7e5824b">uart0</a>, 0));</div>
<div class="line">    <a class="code hl_function" href="group__hardware__gpio.html#ga22f6b90c4c7e0013b4b5341de0a44fc4">gpio_set_function</a>(1, <a class="code hl_define" href="group__hardware__uart.html#ga7bceb145d3739e3923f64584eff6db59">UART_FUNCSEL_NUM</a>(<a class="code hl_define" href="group__hardware__uart.html#ga4c45ff280c79aa60358d8241b7e5824b">uart0</a>, 1));</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Initialise UART 0</span></div>
<div class="line">    <a class="code hl_function" href="group__hardware__uart.html#ga5a55924eff530aff6db3b15fd872cda4">uart_init</a>(<a class="code hl_define" href="group__hardware__uart.html#ga4c45ff280c79aa60358d8241b7e5824b">uart0</a>, 115200);</div>
<div class="line"> </div>
<div class="line">    <a class="code hl_function" href="group__hardware__uart.html#ga94be41517216933ca961fd0464f74a6c">uart_puts</a>(<a class="code hl_define" href="group__hardware__uart.html#ga4c45ff280c79aa60358d8241b7e5824b">uart0</a>, <span class="stringliteral">&quot;Hello world!&quot;</span>);</div>
<div class="line">}</div>
<div class="ttc" id="agroup__hardware__gpio_html_ga22f6b90c4c7e0013b4b5341de0a44fc4"><div class="ttname"><a href="group__hardware__gpio.html#ga22f6b90c4c7e0013b4b5341de0a44fc4">gpio_set_function</a></div><div class="ttdeci">void gpio_set_function(uint gpio, gpio_function_t fn)</div><div class="ttdoc">Select GPIO function.</div><div class="ttdef"><b>Definition:</b> gpio.c:38</div></div>
<div class="ttc" id="agroup__hardware__uart_html_ga4c45ff280c79aa60358d8241b7e5824b"><div class="ttname"><a href="group__hardware__uart.html#ga4c45ff280c79aa60358d8241b7e5824b">uart0</a></div><div class="ttdeci">#define uart0</div><div class="ttdoc">Identifier for UART instance 0.</div><div class="ttdef"><b>Definition:</b> uart.h:86</div></div>
<div class="ttc" id="agroup__hardware__uart_html_ga5a55924eff530aff6db3b15fd872cda4"><div class="ttname"><a href="group__hardware__uart.html#ga5a55924eff530aff6db3b15fd872cda4">uart_init</a></div><div class="ttdeci">uint uart_init(uart_inst_t *uart, uint baudrate)</div><div class="ttdoc">Initialise a UART.</div><div class="ttdef"><b>Definition:</b> uart.c:42</div></div>
<div class="ttc" id="agroup__hardware__uart_html_ga7bceb145d3739e3923f64584eff6db59"><div class="ttname"><a href="group__hardware__uart.html#ga7bceb145d3739e3923f64584eff6db59">UART_FUNCSEL_NUM</a></div><div class="ttdeci">#define UART_FUNCSEL_NUM(uart, gpio)</div><div class="ttdoc">Returns gpio_function_t needed to select the UART function for the given UART instance on the given G...</div><div class="ttdef"><b>Definition:</b> uart.h:179</div></div>
<div class="ttc" id="agroup__hardware__uart_html_ga94be41517216933ca961fd0464f74a6c"><div class="ttname"><a href="group__hardware__uart.html#ga94be41517216933ca961fd0464f74a6c">uart_puts</a></div><div class="ttdeci">static void uart_puts(uart_inst_t *uart, const char *s)</div><div class="ttdoc">Write string to UART for transmission, doing any CR/LF conversions.</div><div class="ttdef"><b>Definition:</b> uart.h:524</div></div>
</div><!-- fragment --> <h2 class="groupheader">Macro Definition Documentation</h2>
<a id="ga4c45ff280c79aa60358d8241b7e5824b" name="ga4c45ff280c79aa60358d8241b7e5824b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4c45ff280c79aa60358d8241b7e5824b">&#9670;&nbsp;</a></span>uart0</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define uart0&#160;&#160;&#160;((uart_inst_t *)uart0_hw)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Identifier for UART instance 0. </p>
<p >The UART identifiers for use in UART functions.</p>
<p >e.g. uart_init(uart1, 48000) </p>

</div>
</div>
<a id="ga8b4f387572a62cc839eb004ce7c02e3f" name="ga8b4f387572a62cc839eb004ce7c02e3f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8b4f387572a62cc839eb004ce7c02e3f">&#9670;&nbsp;</a></span>UART_CLOCK_NUM</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define UART_CLOCK_NUM</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">uart</td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns <a class="el" href="group__hardware__clocks.html#ga824c11c2ae315e0b745f6dd3db936788">clock_num_t</a> of the clock for the given UART instance. </p>
<p >Note this macro is intended to resolve at compile time, and does no parameter checking </p>

</div>
</div>
<a id="ga10472af6afab1cb220b5fbd4aee63a16" name="ga10472af6afab1cb220b5fbd4aee63a16"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga10472af6afab1cb220b5fbd4aee63a16">&#9670;&nbsp;</a></span>UART_DREQ_NUM</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define UART_DREQ_NUM</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">uart, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">is_tx&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the <a class="el" href="group__hardware__dma.html#ga8def0ea481095c94f3a0dd0b4fed999e">dreq_num_t</a> used for pacing DMA transfers to or from this UART instance. If is_tx is true, then it is for transfers to the UART else for transfers from the UART. </p>
<p >Note this macro is intended to resolve at compile time, and does no parameter checking </p>

</div>
</div>
<a id="ga7bceb145d3739e3923f64584eff6db59" name="ga7bceb145d3739e3923f64584eff6db59"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7bceb145d3739e3923f64584eff6db59">&#9670;&nbsp;</a></span>UART_FUNCSEL_NUM</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define UART_FUNCSEL_NUM</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">uart, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">gpio&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns <a class="el" href="group__hardware__gpio.html#ga89b8e5e8a9c515260dea8d1fa96e72c9">gpio_function_t</a> needed to select the UART function for the given UART instance on the given GPIO number. </p>
<p >Note this macro is intended to resolve at compile time, and does no parameter checking </p>

</div>
</div>
<a id="gadc5c5947dc577aac3d448fdb37647927" name="gadc5c5947dc577aac3d448fdb37647927"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gadc5c5947dc577aac3d448fdb37647927">&#9670;&nbsp;</a></span>UART_INSTANCE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define UART_INSTANCE</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">num</td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the UART instance with the given UART number. </p>
<p >Note this macro is intended to resolve at compile time, and does no parameter checking </p>

</div>
</div>
<a id="ga8697ddad82a2cd5d889ce819d83783e3" name="ga8697ddad82a2cd5d889ce819d83783e3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8697ddad82a2cd5d889ce819d83783e3">&#9670;&nbsp;</a></span>UART_IRQ_NUM</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define UART_IRQ_NUM</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">uart</td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the <a class="el" href="group__hardware__irq.html#gaf30862f51b5994ffd5863176a185d137">irq_num_t</a> for processor interrupts from the given UART instance. </p>
<p >Note this macro is intended to resolve at compile time, and does no parameter checking </p>

</div>
</div>
<a id="ga12815b6262573d95c8a749f64cc85284" name="ga12815b6262573d95c8a749f64cc85284"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga12815b6262573d95c8a749f64cc85284">&#9670;&nbsp;</a></span>UART_NUM</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define UART_NUM</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">uart</td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the UART number for a UART instance. </p>
<p >Note this macro is intended to resolve at compile time, and does no parameter checking </p>

</div>
</div>
<a id="gaffef755f98d8fcec5f7b5147924fb4f9" name="gaffef755f98d8fcec5f7b5147924fb4f9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaffef755f98d8fcec5f7b5147924fb4f9">&#9670;&nbsp;</a></span>UART_RESET_NUM</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define UART_RESET_NUM</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">uart</td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the <a class="el" href="group__hardware__resets.html#ga53804b75cce5eb3090d482b0af2a7ce0">reset_num_t</a> used to reset a given UART instance. </p>
<p >Note this macro is intended to resolve at compile time, and does no parameter checking </p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga85b12f7d19f5087b22f26473039d2c4f" name="ga85b12f7d19f5087b22f26473039d2c4f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga85b12f7d19f5087b22f26473039d2c4f">&#9670;&nbsp;</a></span>uart_deinit()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void uart_deinit </td>
          <td>(</td>
          <td class="paramtype">uart_inst_t *&#160;</td>
          <td class="paramname"><em>uart</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>DeInitialise a UART. </p>
<p >Disable the UART if it is no longer used. Must be reinitialised before being used again.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uart</td><td>UART instance. <a class="el" href="group__hardware__uart.html#ga4c45ff280c79aa60358d8241b7e5824b">uart0</a> or <a class="el" href="group__hardware__uart.html#gad94ac6d5e345a1f794174d9bb7c6f69c">uart1</a> </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gaee105a6aeabd79da9244a098865e28cd" name="gaee105a6aeabd79da9244a098865e28cd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaee105a6aeabd79da9244a098865e28cd">&#9670;&nbsp;</a></span>uart_get_dreq_num()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static uint uart_get_dreq_num </td>
          <td>(</td>
          <td class="paramtype">uart_inst_t *&#160;</td>
          <td class="paramname"><em>uart</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>is_tx</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Return the <a class="el" href="group__hardware__dma.html#ga8def0ea481095c94f3a0dd0b4fed999e">dreq_num_t</a> to use for pacing transfers to/from a particular UART instance. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uart</td><td>UART instance. <a class="el" href="group__hardware__uart.html#ga4c45ff280c79aa60358d8241b7e5824b">uart0</a> or <a class="el" href="group__hardware__uart.html#gad94ac6d5e345a1f794174d9bb7c6f69c">uart1</a> </td></tr>
    <tr><td class="paramname">is_tx</td><td>true for sending data to the UART instance, false for receiving data from the UART instance </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga460772353a17df99adaf3352115c73d5" name="ga460772353a17df99adaf3352115c73d5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga460772353a17df99adaf3352115c73d5">&#9670;&nbsp;</a></span>uart_get_hw()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="structuart__hw__t.html">uart_hw_t</a> * uart_get_hw </td>
          <td>(</td>
          <td class="paramtype">uart_inst_t *&#160;</td>
          <td class="paramname"><em>uart</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Get the real hardware UART instance from a UART instance. </p>
<p >This extra level of abstraction was added to facilitate adding PIO UARTs in the future. It currently does nothing, and costs nothing.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uart</td><td>UART instance </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The <a class="el" href="structuart__hw__t.html">uart_hw_t</a> pointer to the UART instance registers </dd></dl>

</div>
</div>
<a id="ga064c5c42afff8712a612d7ae50a58484" name="ga064c5c42afff8712a612d7ae50a58484"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga064c5c42afff8712a612d7ae50a58484">&#9670;&nbsp;</a></span>uart_get_index()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static uint uart_get_index </td>
          <td>(</td>
          <td class="paramtype">uart_inst_t *&#160;</td>
          <td class="paramname"><em>uart</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Convert UART instance to hardware instance number. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uart</td><td>UART instance </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Number of UART, 0 or 1. </dd></dl>

</div>
</div>
<a id="gafd9aaeaae78307db7f51aa39f501b972" name="gafd9aaeaae78307db7f51aa39f501b972"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gafd9aaeaae78307db7f51aa39f501b972">&#9670;&nbsp;</a></span>uart_get_instance()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static uart_inst_t * uart_get_instance </td>
          <td>(</td>
          <td class="paramtype">uint&#160;</td>
          <td class="paramname"><em>num</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Get the UART instance from an instance number. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uart</td><td>UART instance </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Number of UART, 0 or 1 </dd></dl>

</div>
</div>
<a id="ga0759dec413fb5af3bcaa9691ba98bcb9" name="ga0759dec413fb5af3bcaa9691ba98bcb9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0759dec413fb5af3bcaa9691ba98bcb9">&#9670;&nbsp;</a></span>uart_get_reset_num()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static uint uart_get_reset_num </td>
          <td>(</td>
          <td class="paramtype">uart_inst_t *&#160;</td>
          <td class="paramname"><em>uart</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Return the <a class="el" href="group__hardware__resets.html#ga53804b75cce5eb3090d482b0af2a7ce0">reset_num_t</a> to use for pacing transfers to/from a particular UART instance. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uart</td><td>UART instance. <a class="el" href="group__hardware__uart.html#ga4c45ff280c79aa60358d8241b7e5824b">uart0</a> or <a class="el" href="group__hardware__uart.html#gad94ac6d5e345a1f794174d9bb7c6f69c">uart1</a> </td></tr>
    <tr><td class="paramname">is_tx</td><td>true for sending data to the UART instance, false for receiving data from the UART instance </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga652497b933112c1759f892a03c657fec" name="ga652497b933112c1759f892a03c657fec"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga652497b933112c1759f892a03c657fec">&#9670;&nbsp;</a></span>uart_getc()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static char uart_getc </td>
          <td>(</td>
          <td class="paramtype">uart_inst_t *&#160;</td>
          <td class="paramname"><em>uart</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Read a single character from the UART. </p>
<p >This function will block until a character has been read</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uart</td><td>UART instance. <a class="el" href="group__hardware__uart.html#ga4c45ff280c79aa60358d8241b7e5824b">uart0</a> or <a class="el" href="group__hardware__uart.html#gad94ac6d5e345a1f794174d9bb7c6f69c">uart1</a> </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The character read. </dd></dl>

</div>
</div>
<a id="ga5a55924eff530aff6db3b15fd872cda4" name="ga5a55924eff530aff6db3b15fd872cda4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5a55924eff530aff6db3b15fd872cda4">&#9670;&nbsp;</a></span>uart_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint uart_init </td>
          <td>(</td>
          <td class="paramtype">uart_inst_t *&#160;</td>
          <td class="paramname"><em>uart</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint&#160;</td>
          <td class="paramname"><em>baudrate</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialise a UART. </p>
<p >Put the UART into a known state, and enable it. Must be called before other functions.</p>
<p >This function always enables the FIFOs, and configures the UART for the following default line format:</p>
<ul>
<li>8 data bits</li>
<li>No parity bit</li>
<li>One stop bit</li>
</ul>
<dl class="section note"><dt>Note</dt><dd>There is no guarantee that the baudrate requested will be possible, the nearest will be chosen, and this function will return the configured baud rate.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uart</td><td>UART instance. <a class="el" href="group__hardware__uart.html#ga4c45ff280c79aa60358d8241b7e5824b">uart0</a> or <a class="el" href="group__hardware__uart.html#gad94ac6d5e345a1f794174d9bb7c6f69c">uart1</a> </td></tr>
    <tr><td class="paramname">baudrate</td><td>Baudrate of UART in Hz </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Actual set baudrate </dd></dl>

</div>
</div>
<a id="ga6397bfad56e634a2ab31b6953a44caa7" name="ga6397bfad56e634a2ab31b6953a44caa7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6397bfad56e634a2ab31b6953a44caa7">&#9670;&nbsp;</a></span>uart_is_enabled()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static bool uart_is_enabled </td>
          <td>(</td>
          <td class="paramtype">uart_inst_t *&#160;</td>
          <td class="paramname"><em>uart</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Test if specific UART is enabled. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uart</td><td>UART instance. <a class="el" href="group__hardware__uart.html#ga4c45ff280c79aa60358d8241b7e5824b">uart0</a> or <a class="el" href="group__hardware__uart.html#gad94ac6d5e345a1f794174d9bb7c6f69c">uart1</a> </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if the UART is enabled </dd></dl>

</div>
</div>
<a id="ga4752e5d03dd98a08d95705f68784fd15" name="ga4752e5d03dd98a08d95705f68784fd15"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4752e5d03dd98a08d95705f68784fd15">&#9670;&nbsp;</a></span>uart_is_readable()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static bool uart_is_readable </td>
          <td>(</td>
          <td class="paramtype">uart_inst_t *&#160;</td>
          <td class="paramname"><em>uart</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Determine whether data is waiting in the RX FIFO. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uart</td><td>UART instance. <a class="el" href="group__hardware__uart.html#ga4c45ff280c79aa60358d8241b7e5824b">uart0</a> or <a class="el" href="group__hardware__uart.html#gad94ac6d5e345a1f794174d9bb7c6f69c">uart1</a> </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if the RX FIFO is not empty, otherwise false. </dd></dl>

</div>
</div>
<a id="ga026539f355b6c6f5a044a5f4ee051f0e" name="ga026539f355b6c6f5a044a5f4ee051f0e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga026539f355b6c6f5a044a5f4ee051f0e">&#9670;&nbsp;</a></span>uart_is_readable_within_us()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool uart_is_readable_within_us </td>
          <td>(</td>
          <td class="paramtype">uart_inst_t *&#160;</td>
          <td class="paramname"><em>uart</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>us</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Wait for up to a certain number of microseconds for the RX FIFO to be non empty. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uart</td><td>UART instance. <a class="el" href="group__hardware__uart.html#ga4c45ff280c79aa60358d8241b7e5824b">uart0</a> or <a class="el" href="group__hardware__uart.html#gad94ac6d5e345a1f794174d9bb7c6f69c">uart1</a> </td></tr>
    <tr><td class="paramname">us</td><td>the number of microseconds to wait at most (may be 0 for an instantaneous check) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if the RX FIFO became non empty before the timeout, false otherwise </dd></dl>

</div>
</div>
<a id="ga9d307ef71e3ce632be03bfd9bbe68117" name="ga9d307ef71e3ce632be03bfd9bbe68117"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9d307ef71e3ce632be03bfd9bbe68117">&#9670;&nbsp;</a></span>uart_is_writable()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static bool uart_is_writable </td>
          <td>(</td>
          <td class="paramtype">uart_inst_t *&#160;</td>
          <td class="paramname"><em>uart</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Determine if space is available in the TX FIFO. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uart</td><td>UART instance. <a class="el" href="group__hardware__uart.html#ga4c45ff280c79aa60358d8241b7e5824b">uart0</a> or <a class="el" href="group__hardware__uart.html#gad94ac6d5e345a1f794174d9bb7c6f69c">uart1</a> </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>false if no space available, true otherwise </dd></dl>

</div>
</div>
<a id="ga21c2cc29dcdc99ad970024dca52665a5" name="ga21c2cc29dcdc99ad970024dca52665a5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga21c2cc29dcdc99ad970024dca52665a5">&#9670;&nbsp;</a></span>uart_putc()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void uart_putc </td>
          <td>(</td>
          <td class="paramtype">uart_inst_t *&#160;</td>
          <td class="paramname"><em>uart</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char&#160;</td>
          <td class="paramname"><em>c</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Write single character to UART for transmission, with optional CR/LF conversions. </p>
<p >This function will block until the character has been sent to the UART transmit buffer</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uart</td><td>UART instance. <a class="el" href="group__hardware__uart.html#ga4c45ff280c79aa60358d8241b7e5824b">uart0</a> or <a class="el" href="group__hardware__uart.html#gad94ac6d5e345a1f794174d9bb7c6f69c">uart1</a> </td></tr>
    <tr><td class="paramname">c</td><td>The character to send </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga64aa17c4b4382a59f7cb80c94f339d56" name="ga64aa17c4b4382a59f7cb80c94f339d56"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga64aa17c4b4382a59f7cb80c94f339d56">&#9670;&nbsp;</a></span>uart_putc_raw()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void uart_putc_raw </td>
          <td>(</td>
          <td class="paramtype">uart_inst_t *&#160;</td>
          <td class="paramname"><em>uart</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char&#160;</td>
          <td class="paramname"><em>c</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Write single character to UART for transmission. </p>
<p >This function will block until the entire character has been sent to the UART transmit buffer</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uart</td><td>UART instance. <a class="el" href="group__hardware__uart.html#ga4c45ff280c79aa60358d8241b7e5824b">uart0</a> or <a class="el" href="group__hardware__uart.html#gad94ac6d5e345a1f794174d9bb7c6f69c">uart1</a> </td></tr>
    <tr><td class="paramname">c</td><td>The character to send </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga94be41517216933ca961fd0464f74a6c" name="ga94be41517216933ca961fd0464f74a6c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga94be41517216933ca961fd0464f74a6c">&#9670;&nbsp;</a></span>uart_puts()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void uart_puts </td>
          <td>(</td>
          <td class="paramtype">uart_inst_t *&#160;</td>
          <td class="paramname"><em>uart</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>s</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Write string to UART for transmission, doing any CR/LF conversions. </p>
<p >This function will block until the entire string has been sent to the UART transmit buffer</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uart</td><td>UART instance. <a class="el" href="group__hardware__uart.html#ga4c45ff280c79aa60358d8241b7e5824b">uart0</a> or <a class="el" href="group__hardware__uart.html#gad94ac6d5e345a1f794174d9bb7c6f69c">uart1</a> </td></tr>
    <tr><td class="paramname">s</td><td>The null terminated string to send </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gae8a066ef7339e7b22f05049435469234" name="gae8a066ef7339e7b22f05049435469234"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae8a066ef7339e7b22f05049435469234">&#9670;&nbsp;</a></span>uart_read_blocking()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void uart_read_blocking </td>
          <td>(</td>
          <td class="paramtype">uart_inst_t *&#160;</td>
          <td class="paramname"><em>uart</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Read from the UART. </p>
<p >This function blocks until len characters have been read from the UART</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uart</td><td>UART instance. <a class="el" href="group__hardware__uart.html#ga4c45ff280c79aa60358d8241b7e5824b">uart0</a> or <a class="el" href="group__hardware__uart.html#gad94ac6d5e345a1f794174d9bb7c6f69c">uart1</a> </td></tr>
    <tr><td class="paramname">dst</td><td>Buffer to accept received bytes </td></tr>
    <tr><td class="paramname">len</td><td>The number of bytes to receive. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gab7f2ad3380a44597d8dda42b2d2ddef9" name="gab7f2ad3380a44597d8dda42b2d2ddef9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab7f2ad3380a44597d8dda42b2d2ddef9">&#9670;&nbsp;</a></span>uart_set_baudrate()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint uart_set_baudrate </td>
          <td>(</td>
          <td class="paramtype">uart_inst_t *&#160;</td>
          <td class="paramname"><em>uart</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint&#160;</td>
          <td class="paramname"><em>baudrate</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set UART baud rate. </p>
<p >Set baud rate as close as possible to requested, and return actual rate selected.</p>
<p >The UART is paused for around two character periods whilst the settings are changed. Data received during this time may be dropped by the UART.</p>
<p >Any characters still in the transmit buffer will be sent using the new updated baud rate. <a class="el" href="group__hardware__uart.html#gaff99ad133c2c808b69d1e12054c09f4a" title="Wait for the UART TX fifo to be drained.">uart_tx_wait_blocking()</a> can be called before this function to ensure all characters at the old baud rate have been sent before the rate is changed.</p>
<p >This function should not be called from an interrupt context, and the UART interrupt should be disabled before calling this function.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uart</td><td>UART instance. <a class="el" href="group__hardware__uart.html#ga4c45ff280c79aa60358d8241b7e5824b">uart0</a> or <a class="el" href="group__hardware__uart.html#gad94ac6d5e345a1f794174d9bb7c6f69c">uart1</a> </td></tr>
    <tr><td class="paramname">baudrate</td><td>Baudrate in Hz </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Actual set baudrate </dd></dl>

</div>
</div>
<a id="gaddb01507886acab5604a2eecc014b388" name="gaddb01507886acab5604a2eecc014b388"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaddb01507886acab5604a2eecc014b388">&#9670;&nbsp;</a></span>uart_set_break()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void uart_set_break </td>
          <td>(</td>
          <td class="paramtype">uart_inst_t *&#160;</td>
          <td class="paramname"><em>uart</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>en</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Assert a break condition on the UART transmission. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uart</td><td>UART instance. <a class="el" href="group__hardware__uart.html#ga4c45ff280c79aa60358d8241b7e5824b">uart0</a> or <a class="el" href="group__hardware__uart.html#gad94ac6d5e345a1f794174d9bb7c6f69c">uart1</a> </td></tr>
    <tr><td class="paramname">en</td><td>Assert break condition (TX held low) if true. Clear break condition if false. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gac3daee9514dacfb76f3c04b131e2e41a" name="gac3daee9514dacfb76f3c04b131e2e41a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac3daee9514dacfb76f3c04b131e2e41a">&#9670;&nbsp;</a></span>uart_set_fifo_enabled()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void uart_set_fifo_enabled </td>
          <td>(</td>
          <td class="paramtype">uart_inst_t *&#160;</td>
          <td class="paramname"><em>uart</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>enabled</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enable/Disable the FIFOs on specified UART. </p>
<p >The UART is paused for around two character periods whilst the settings are changed. Data received during this time may be dropped by the UART.</p>
<p >Any characters still in the transmit FIFO will be lost if the FIFO is disabled. <a class="el" href="group__hardware__uart.html#gaff99ad133c2c808b69d1e12054c09f4a" title="Wait for the UART TX fifo to be drained.">uart_tx_wait_blocking()</a> can be called before this function to avoid this.</p>
<p >This function should not be called from an interrupt context, and the UART interrupt should be disabled when calling this function.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uart</td><td>UART instance. <a class="el" href="group__hardware__uart.html#ga4c45ff280c79aa60358d8241b7e5824b">uart0</a> or <a class="el" href="group__hardware__uart.html#gad94ac6d5e345a1f794174d9bb7c6f69c">uart1</a> </td></tr>
    <tr><td class="paramname">enabled</td><td>true to enable FIFO (default), false to disable </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga07e3c6ce7c1abf5e875b62964b8f841e" name="ga07e3c6ce7c1abf5e875b62964b8f841e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga07e3c6ce7c1abf5e875b62964b8f841e">&#9670;&nbsp;</a></span>uart_set_format()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void uart_set_format </td>
          <td>(</td>
          <td class="paramtype">uart_inst_t *&#160;</td>
          <td class="paramname"><em>uart</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint&#160;</td>
          <td class="paramname"><em>data_bits</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint&#160;</td>
          <td class="paramname"><em>stop_bits</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__hardware__uart.html#ga6bcc37e31dd40c204b4ac6f6189e8878">uart_parity_t</a>&#160;</td>
          <td class="paramname"><em>parity</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set UART data format. </p>
<p >Configure the data format (bits etc) for the UART.</p>
<p >The UART is paused for around two character periods whilst the settings are changed. Data received during this time may be dropped by the UART.</p>
<p >Any characters still in the transmit buffer will be sent using the new updated data format. <a class="el" href="group__hardware__uart.html#gaff99ad133c2c808b69d1e12054c09f4a" title="Wait for the UART TX fifo to be drained.">uart_tx_wait_blocking()</a> can be called before this function to ensure all characters needing the old format have been sent before the format is changed.</p>
<p >This function should not be called from an interrupt context, and the UART interrupt should be disabled before calling this function.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uart</td><td>UART instance. <a class="el" href="group__hardware__uart.html#ga4c45ff280c79aa60358d8241b7e5824b">uart0</a> or <a class="el" href="group__hardware__uart.html#gad94ac6d5e345a1f794174d9bb7c6f69c">uart1</a> </td></tr>
    <tr><td class="paramname">data_bits</td><td>Number of bits of data. 5..8 </td></tr>
    <tr><td class="paramname">stop_bits</td><td>Number of stop bits 1..2 </td></tr>
    <tr><td class="paramname">parity</td><td>Parity option. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga54a9e298ebec96510e324bbab01247c7" name="ga54a9e298ebec96510e324bbab01247c7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga54a9e298ebec96510e324bbab01247c7">&#9670;&nbsp;</a></span>uart_set_hw_flow()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void uart_set_hw_flow </td>
          <td>(</td>
          <td class="paramtype">uart_inst_t *&#160;</td>
          <td class="paramname"><em>uart</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>cts</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>rts</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Set UART flow control CTS/RTS. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uart</td><td>UART instance. <a class="el" href="group__hardware__uart.html#ga4c45ff280c79aa60358d8241b7e5824b">uart0</a> or <a class="el" href="group__hardware__uart.html#gad94ac6d5e345a1f794174d9bb7c6f69c">uart1</a> </td></tr>
    <tr><td class="paramname">cts</td><td>If true enable flow control of TX by clear-to-send input </td></tr>
    <tr><td class="paramname">rts</td><td>If true enable assertion of request-to-send output by RX flow control </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga1908247cb5f2468517b37d5a91798181" name="ga1908247cb5f2468517b37d5a91798181"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1908247cb5f2468517b37d5a91798181">&#9670;&nbsp;</a></span>uart_set_irqs_enabled()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void uart_set_irqs_enabled </td>
          <td>(</td>
          <td class="paramtype">uart_inst_t *&#160;</td>
          <td class="paramname"><em>uart</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>rx_has_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>tx_needs_data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Enable/Disable UART interrupt outputs. </p>
<p >Enable/Disable the UART's interrupt outputs. An interrupt handler should be installed prior to calling this function.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uart</td><td>UART instance. <a class="el" href="group__hardware__uart.html#ga4c45ff280c79aa60358d8241b7e5824b">uart0</a> or <a class="el" href="group__hardware__uart.html#gad94ac6d5e345a1f794174d9bb7c6f69c">uart1</a> </td></tr>
    <tr><td class="paramname">rx_has_data</td><td>If true an interrupt will be fired when the RX FIFO contains data. </td></tr>
    <tr><td class="paramname">tx_needs_data</td><td>If true an interrupt will be fired when the TX FIFO needs data. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga4ea0b7b9252cd22e2395ca6070000f7a" name="ga4ea0b7b9252cd22e2395ca6070000f7a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4ea0b7b9252cd22e2395ca6070000f7a">&#9670;&nbsp;</a></span>uart_set_translate_crlf()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void uart_set_translate_crlf </td>
          <td>(</td>
          <td class="paramtype">uart_inst_t *&#160;</td>
          <td class="paramname"><em>uart</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>translate</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set CR/LF conversion on UART. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uart</td><td>UART instance. <a class="el" href="group__hardware__uart.html#ga4c45ff280c79aa60358d8241b7e5824b">uart0</a> or <a class="el" href="group__hardware__uart.html#gad94ac6d5e345a1f794174d9bb7c6f69c">uart1</a> </td></tr>
    <tr><td class="paramname">translate</td><td>If true, convert line feeds to carriage return on transmissions </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gaff99ad133c2c808b69d1e12054c09f4a" name="gaff99ad133c2c808b69d1e12054c09f4a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaff99ad133c2c808b69d1e12054c09f4a">&#9670;&nbsp;</a></span>uart_tx_wait_blocking()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void uart_tx_wait_blocking </td>
          <td>(</td>
          <td class="paramtype">uart_inst_t *&#160;</td>
          <td class="paramname"><em>uart</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Wait for the UART TX fifo to be drained. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uart</td><td>UART instance. <a class="el" href="group__hardware__uart.html#ga4c45ff280c79aa60358d8241b7e5824b">uart0</a> or <a class="el" href="group__hardware__uart.html#gad94ac6d5e345a1f794174d9bb7c6f69c">uart1</a> </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gada6a512414b1113a59725ddfbe23c4a5" name="gada6a512414b1113a59725ddfbe23c4a5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gada6a512414b1113a59725ddfbe23c4a5">&#9670;&nbsp;</a></span>uart_write_blocking()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void uart_write_blocking </td>
          <td>(</td>
          <td class="paramtype">uart_inst_t *&#160;</td>
          <td class="paramname"><em>uart</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Write to the UART for transmission. </p>
<p >This function will block until all the data has been sent to the UART transmit buffer hardware. Note: Serial data transmission will continue until the Tx FIFO and the transmit shift register (not programmer-accessible) are empty. To ensure the UART FIFO has been emptied, you can use <a class="el" href="group__hardware__uart.html#gaff99ad133c2c808b69d1e12054c09f4a">uart_tx_wait_blocking()</a></p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uart</td><td>UART instance. <a class="el" href="group__hardware__uart.html#ga4c45ff280c79aa60358d8241b7e5824b">uart0</a> or <a class="el" href="group__hardware__uart.html#gad94ac6d5e345a1f794174d9bb7c6f69c">uart1</a> </td></tr>
    <tr><td class="paramname">src</td><td>The bytes to send </td></tr>
    <tr><td class="paramname">len</td><td>The number of bytes to send </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->

	<script src="main.js"></script>
</body>
</html>